AEGetKeyPtr
AEGetKeyPtr
Get data/descriptor records from AE record/Apple Event typeCode, dataPtr, maximumSize, actualSize );
AERecord * theAERecord ; Apple Event record data source AEKeyword theAEKeyword ; keyword for descriptor record DescType desiredType ; coerced type of the data DescType * typeCode ; descriptor type of returned data Ptr dataPtr ; pointer to data buffer Size maximumSize ; maximum length of data buffer Size * actualSize ; actual size of returned data You can use the AEGetKeyPtr function to get a pointer to a buffer that contains data from a keyword-specified descriptor record. You can use this
function to get data out of an AE record or an Apple event record.
The AEGetKeyPtr function uses a buffer to return the data contained in a keyword-specified Apple event parameter, which it attempts to coerce to the
descriptor type specified by the desiredType parameter.
The parameter theAERecord is the AE record from which to get data.
The parameter theAEKeyword is the keyword that specifies the desired
descriptor record.
The desiredType parameter specifies the descriptor type of the resulting data; coerce it into this type. If the value of desiredType is typeWildCard, no coercion is performed, and the descriptor type of resulting data is the same as
the descriptor type of the original data. The returned data's descriptor type is
returned in the typeCode parameter.
The dataPtr parameter is a pointer to the buffer for storing the data. The maximumSize parameter is the maximum length, in bytes, of the data to be returned.
The AEGetKeyPtr function returns in the actualSize parameter the actual length, in bytes, of the data for the keyword-specified descriptor record. If
this value is larger than the value of maximumSize, not all of the data for the
keyword-specified descriptor record was returned.
Result codes
noErr (0) No error
memFullErr (-108) Not enough room in heap zone
errAECoercionFail (-1700) Data could not be coerced to descriptor type
errAEDescNotFound (-1701) Descriptor record was not found
errAEWrongDataType (-1703) Wrong descriptor type
errAENotAEDesc (-1704) Not a valid descriptor record
errAEReplyNotArrived (-1718) Reply has not yet arrived